package base.thread.saleTicket;

public class Windows implements Runnable{
	private Ticket ticket;
	
	public Windows(Ticket ticket){
		this.ticket=ticket;
	}
	
	public void run(){
		while (true) {
            ticket.saleTicket();
            if(ticket.ticketNum<=0){
                System.out.println("关闭售票窗口"+Thread.currentThread().getName());
                 break;
            }
        } 
	}
	
}
